package cameragps;

public final class EncodingProperties
{
	private String m_format;
	private String m_width;
	private String m_height;
	private String m_quality;
	
	private boolean m_formatSet;
	private boolean m_widthSet;
	private boolean m_heightSet;
	private boolean m_qualitySet;

	public void SetFormat(String format)
	{
		m_format = format;
		m_formatSet = true;
	}
	
	void setWidth(String width)
	{
		m_width = width;
		m_widthSet = true;
	}
	
	void setHeight(String height)
	{
		m_height = height;
		m_heightSet = true;
	}
	
	void setQuality(String quality)
	{
		m_quality = quality;
		m_qualitySet = true;
	}
	
	public String toString()
	{
		StringBuffer display = new StringBuffer();
		
		display.append(m_width);
		display.append(" x ");
		display.append(m_height);
		display.append(" ");
		display.append(m_format);
		display.append(" (");
		display.append(m_quality);
		display.append(")");
		
		return display.toString();
	}
	
	String getFullEncoding()
	{
		StringBuffer fullEncoding = new StringBuffer();
		
		fullEncoding.append("encoding=");
		fullEncoding.append(m_format);
		
		fullEncoding.append("&width=");
		fullEncoding.append(m_width);
		
        fullEncoding.append("&height=");
        fullEncoding.append(m_height);

		
		fullEncoding.append("&quality=");
		fullEncoding.append(m_quality);
		
		return fullEncoding.toString();
	}
	
	boolean isComplete()
	{
		return m_formatSet && m_widthSet && m_heightSet && m_qualitySet;
	}
}